<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>隔行换色</title>
    <script src="js/jquery-1.12.4.js"></script>
</head>
<body>

<table border="1" align="center" width="60%" height="500px" cellspacing="0" cellpadding="5px">
    <tr>
        <th>序号</th>
        <th>姓名</th>
        <th>年龄</th>
        <th>地址</th>
        <th>电话</th>
    </tr>
    <tr>
        <td>1</td>
        <td>王佳欣</td>
        <td>18</td>
        <td>中国北科</td>
        <td>15812341234</td>
    </tr>
    <tr>
        <td>2</td>
        <td>王佳欣</td>
        <td>18</td>
        <td>中国北科</td>
        <td>15812341234</td>
    </tr>
    <tr>
        <td>3</td>
        <td>王佳欣</td>
        <td>18</td>
        <td>中国北科</td>
        <td>15812341234</td>
    </tr>
    <tr>
        <td>4</td>
        <td>王佳欣</td>
        <td>18</td>
        <td>中国北科</td>
        <td>15812341234</td>
    </tr>
    <tr>
        <td>5</td>
        <td>王佳欣</td>
        <td>18</td>
        <td>中国北科</td>
        <td>15812341234</td>
    </tr>
    <tr>
        <td>6</td>
        <td>王佳欣</td>
        <td>18</td>
        <td>中国北科</td>
        <td>15812341234</td>
    </tr>
    <tr>
        <td>7</td>
        <td>王佳欣</td>
        <td>18</td>
        <td>中国北科</td>
        <td>15812341234</td>
    </tr>
    <tr>
        <td>8</td>
        <td>王佳欣</td>
        <td>18</td>
        <td>中国北科</td>
        <td>15812341234</td>
    </tr>
    <tr>
        <td>9</td>
        <td>王佳欣</td>
        <td>18</td>
        <td>中国北科</td>
        <td>15812341234</td>
    </tr>
</table>
<script>
    $(function() {
        $("tr:even").css("backgroundColor", "gray");
        $("tr:odd").css("backgroundColor", "pink");
    });
</script>

</body>
</html>